********************************************************************

Replication Data for: "The Effects of Polarized Evaluations on
Political Participation: Does Hating the Other Side Motivate Voters?"

Author: Chloe Ahn, Diana C. Mutz
Date: November 2022

********************************************************************/

**Panel analysis**

import delimited "poq_panel_data.csv"
keep affpol affpol_candidate idstrength caseid wave
reshape wide affpol affpol_candidate idstrength, i(caseid) j(wave)
gen Daffpol=real(affpol1)-real(affpol6)
egen DaffpolSD = sd(Daffpol)
*DaffpolSD = 5.6573672*
gen Daffpol_candidate=real(affpol_candidate1)-real(affpol_candidate6)
egen Daffpol_candidateSD = sd(Daffpol_candidate)
*DaffpolSD = 5.6435943*
gen Didstrength=real(idstrength1)-real(idstrength6)
egen DidstrengthSD = sd(Didstrength)
*DaffpolSD = 0.657*

clear

*re-load the data*
import delimited "poq_panel_data.csv"
gen Affpol = real(affpol)/5.6573672
gen Affpol_candidate = real(affpol_candidate)/5.6435943
gen Idstrength = real(idstrength)/0.657

destring turnout validated_turnout, replace force
gen Wave=.
replace Wave=0 if wave==1
replace Wave=1 if wave==6
gen Turnout=.
replace Turnout=0 if turnout==0
replace Turnout=1 if turnout==1
drop if Turnout==.
gen Vturnout=.
replace Vturnout=0 if validated_turnout==0
replace Vturnout=1 if validated_turnout==1
drop if Vturnout==.

*panel analysis*
xtset caseid Wave

*main text table 1, model 1*
xtlogit Turnout Affpol Idstrength Wave, fe or
*main text table 1, model 2*
xtlogit Turnout Affpol_candidate Idstrength Wave, fe or
*main text table 1, model 3*
xtlogit Turnout Affpol Affpol_candidate Idstrength Wave, fe or

*main text table 2, model 1*
xtlogit Vturnout Affpol Idstrength Wave, fe or
*main text table 2, model 2*
xtlogit Vturnout Affpol_candidate Idstrength Wave, fe or
*main text table 2, model 3*
xtlogit Vturnout Affpol Affpol_candidate Idstrength Wave, fe or